package com.zdyt.opc.common;

import org.openscada.opc.lib.da.ServerConnectionStateListener;

import java.util.concurrent.CountDownLatch;

public class CustomConnectListener implements ServerConnectionStateListener {

    private CountDownLatch countDownLatch;

    public CustomConnectListener(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void connectionStateChanged(boolean connected) {
        if (connected){
            countDownLatch.countDown();
        }
    }
}
